@import '../color.scss';

.el-table {
    color: #333;
    font-size: 12px;
    border-color: #e6e6e6;
    border-radius: 5px;
    // 全局修改 table 的hover样式
    .el-table--enable-row-hover .el-table__body tr:hover>td,
    .el-table__body tr.hover-row.el-table__row--striped>td,
    .el-table__body tr:hover>td,
    tr.hover-row> td {
        background-color: $lightColor;
    }
    // 解决Safari兼容问题
    .el-table__body { width: 100%; }
    // 全局修改 table 单选样式
    .el-table--striped .el-table__body tr.el-table__row--striped.current-row td,
    .el-table__body tr.current-row > td,
    .el-table__body tr.hover-row.el-table__row--striped.current-row > td {
        background-color: #8dcbf3 !important;
    }

    .el-table--border td,
    .el-table--border th,
    .el-table__body-wrapper .el-table--border.is-scrolling-left~.el-table__fixed {
        border-color: #e6e6e6;
    }

    .el-table--border th.gutter{
        display: block !important;
    }

    .el-table-column--selection .cell {
        text-overflow: clip !important;
    }

    .el-table__expanded-cell[class*=cell]{
        padding: 20px;
    }
    .el-table__body tr.warning-row.el-table__row--striped>td,
    tr.warning-row> td {
        background-color: #fdf5e6;
    }
    .el-table__body tr.twinkle-warning-row.el-table__row--striped>td,
    tr.twinkle-warning-row> td {
        background-color: #fdf5e6;
        animation: twinkle 2s forwards;
    }
    @keyframes twinkle
    {
        0% {background:#fdf5e6;}
        20% {background:#fcedcf;}
        40% {background:#fdf5e6;}
        80% {background:#fcedcf;}
        100% {background:transparent;}
    }
}

.el-table td,
.el-table th.is-leaf {
    border-color: #e6e6e6;
}

.el-table th,
.el-table td {
    padding: 8px 0;
}

.el-table th {
    font-weight: bold;
    color: #333;
}

/* 解决table错位 */
.el-table th.gutter {
    display: table-cell !important;
}



// 表格操作栏-下拉菜单公共样式
.more-dots {
    float: right;
    .el-dropdown-link {
        font-size: 30px;
        line-height: 15px;
        color: #409eff;
        cursor: pointer;
        &:hover {
            color: $mainColor;
        }
    }
}

.more-dropdown {
    border-radius: 5PX;
    padding: 5px 0 0;
    .el-dropdown-menu__item {
        line-height: 1.8;
        padding: 0;
        .el-button--text {
            padding: 10px 20px;
            width: 100%;
            text-align: left;
            color: #409eff;
            font-size: 12px;
            &.is-disabled {
                color: #c0c4cc;
            }
            .el-dropdown-icon {
                color: #409eff;
            }
        }
    }
    .el-dropdown-menu__item:focus,
    .el-dropdown-menu__item:not(.is-disabled):hover {
        .el-button--text {
            color: $mainColor;
            z-index: 2050;
        }
        .el-dropdown-icon {
            color: $mainColor;
            z-index: 2050;
        }
    }
}


.action-cell a,
.action-cell .el-button--text {
    padding: 8px 0;
    color: #409eff;
    font-size: 12px;
    &:hover {
        color: $mainColor;
    }
}

// 表格高度限制
// 限制300px
.table-custom-height200 .el-table__body-wrapper {
    max-height: 200px !important;
    overflow-y: auto;
}

.table-custom-height300 .el-table__body-wrapper {
    max-height: 300px !important;
    overflow-y: auto;
}

// 限制400px
.table-custom-height400 .el-table__body-wrapper {
    max-height: 400px !important;
    overflow-y: auto;
}

// 限制500px
.table-custom-height500 .el-table__body-wrapper {
    max-height: 500px !important;
    overflow-y: auto;
}

.table-row-class-name-disabled {
    color: #c2c2c2 !important;
}
